package edebe.flyinginstrument.item;

import edebe.flyinginstrument.entity.EntityFlySword;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import net.minecraftforge.common.util.EnumHelper;

import static edebe.flyinginstrument.FlyingInstrumentMod.MODID;
import net.mcreator.fabaokuozhan.creativetab.TabLianqi;

public class ItemFlySword extends Item implements IFlyingInstrumentItem{

    public ItemFlySword(String id) {
        super();
        setRegistryName(id);
        setUnlocalizedName(MODID + "." + id);
        setCreativeTab(TabLianqi.tab);
        setMaxStackSize(1);
    }

    public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
    {
//        stack.damageItem(0, attacker);
        return true;
    }
    @Override
    public float getWidth() {
        return 3F;
    }

    @Override
    public float getHeight() {
        return 0.2F;
    }

    @Override
    public double getMountedYOffset() {
        return 0.5;
    }

    @Override
    public float getStepHeight() {
        return 0.2F;
    }

    @Override
    public boolean shouldRiderSit() {
        return false;
    }


    @Override
    public EntityFlySword createEntity(World worldIn, ItemStack stackIn, EntityPlayer playerIn) {
        return new EntityFlySword(worldIn, stackIn, playerIn);
    }
}
